# 使用官方 Nginx 镜像作为基础
FROM nginx:alpine

# 复制构建后的 dist 文件到 Nginx 默认静态文件目录
COPY dist /usr/share/nginx/html

# 暴露端口
EXPOSE 8856

 #自定义 Nginx 配置（可选，禁用缓存）
RUN echo 'server { \
    listen 8856; \
    server_name localhost; \
    location / { \
        root /usr/share/nginx/html; \
        index index.html; \
        try_files $uri $uri/ /index.html; \
        expires -1; \
    } \
}' > /etc/nginx/conf.d/default.conf
#expires -1; \
# 启动 Nginx
CMD ["nginx", "-g", "daemon off;"]